﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Remove hidden text</title>
    <style type="text/css">
        body
        {
            font-family: "Microsoft YaHei", Georgia, Helvetica, Arial, sans-serif, 宋体, serif, PMingLiU;
            color: black;
            background-color: #fff;
            font-size: 10.5pt;
            margin: 1em;
            padding: 1em;
            line-height: 1.5;
        }
        div
        {
            font-size: 1em;
        }
        table
        {
            empty-cells: show;
            margin: 0;
            padding: 0;
        }
        font
        {
            font-size: 1em;
        }
        ul
        {
            padding: 0 0 1em 1em;
        }
        ol
        {
            padding: 0 0 1em 1.3em;
        }
        li
        {
            line-height: 1.5em;
            padding: 0 0 0 0;
        }
        p
        {
            padding: 0;
        }
        h1, h2, h3, h4, h5
        {
            padding: 0;
        }
        h1
        {
            font-size: 1.3em; /*1.3em*/
        }
        h2
        {
            font-size: 1.1em; /*1.3em*/
        }
        h3
        {
            font-size: 1em; /*1.1em;*/ ;line-height:1.4em;white-space:nowrap;padding:0;
        }
        h4, h5, table
        {
            font-size: 1em;
        }
        sup, sub
        {
            font-size: .7em;
        }
        img
        {
            border-style: none;
        }
        a
        {
            outline: none;
            color: #00c;
        }
        a:active
        {
            color: red;
        }
        a:visited
        {
            color: #551a8b;
        }
        hr
        {
            border: 0;
            background-color: #EEE;
            border-bottom: #c9d7f1 1px solid;
            height: 0px;
            width: 99.9%;
            text-align: left;
            margin-top: 1em;
            margin-bottom: 1em;
        }
    </style>
</head>
<body>

<span style="display:none" id="myspan"></span>
    <script language="JavaScript" type="text/jscript">
        //
        var objEditor = window.external;  //获得外部对象，该对象是WizHtmlEditor实现的
        var objDoc = objEditor.Document;  //这个是当前正在编辑的网页的文档对象
        var plugin_path = objEditor.PluginPath;   //这个是当前插件所在的路径
        //
        alert(myspan.style.display == "none");
        //

        function RemoveHiddenText() {
            try {
                var doc = objEditor.document;
                var elements = doc.getElementsByTagName("span");
                for (var i = elements.length - 1; i >= 0; i--) {
                    if (elements[i].style.display == "none") {
                        var node = elements[i];
                        var parentNode = node.parentNode;
                        parentNode.removeChild(node);
                    }
                }
            }
            catch (err) {
                alert(err);
            }
        }
        //
        function CloseDialog(ret) {
            objEditor.CloseDialog(ret);
        }
        //
        RemoveHiddenText();
        CloseDialog(1);
        //
    </script>
</body>
</html>
